package com.x.client.net

import com.x.client.bean.*
import com.x.client.utils.AppConstant
import io.reactivex.Observable
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.GET
import retrofit2.http.POST

/**
 * Creator : GG
 * Date    : 2018/6/13
 * Mail    : gg.jin.yu@gmai.com
 * Explain :
 */
interface ErpApi {

    /**
     * 查询车辆列表
     */
    @FormUrlEncoded
    @POST("controller/getCarList")
    fun carList(@Field("pageIndex") pageIndex: Int,
                @Field("pageSize") pageSize: Int = AppConstant.PageSize,
                @Field("marketId") marketId: String? = "1",
                @Field("shopId") shopId: String? = "",
                @Field("userId") userId: String? = null,
                @Field("carOutColor") carOutColor: String? = null,
                @Field("modelId") modelId: Int? = null,
                @Field("seriesId") seriesId: Int? = null,
                @Field("brandId") brandId: Int? = null,
                @Field("carBargainPriceState") carBargainPriceState: Int? = null,
                @Field("carAuthState") carAuthState: Int? = null,
                @Field("carDetectState") carDetectState: Int? = null,
                @Field("carStockState") carStockState: Int? = null,
                @Field("carPledgeState") carPledgeState: Int? = null,
                @Field("carSaleState") carSaleState: Int? = null,
                @Field("carOrderState") carOrderState: Int? = null,
                @Field("fromRetailPrice") fromRetailPrice: Double? = null,
                @Field("toRetailPrice") toRetailPrice: Double? = null,
                @Field("fromCarAge") fromCarAge: Int? = null,
                @Field("toCarAge") toCarAge: Int? = null,
                @Field("fromCreateTime") fromCreateTime: Int? = null,
                @Field("toCreateTime") toCreateTime: Int? = null,
                @Field("toCreateTime") carTypeId: Int? = null,
                @Field("fromMileage") fromMileage: Int? = null,
                @Field("toMileage") toMileage: Int? = null,
                @Field("orderColunm") orderColunm: String? = null,
                @Field("orderMode") orderMode: String? = null,
                @Field("carCreateTime") carCreateTime: String? = null,
                @Field("carTitle") carTitle: String? = null,
                @Field("carEnviron") carEnviron: String? = null,
                @Field("carVin6") carVin6: String? = null
    ): Observable<Response<List<Car>>>


    /**
     * 获取品牌列表
     */
    @GET("controller/getGroupBrand")
    fun brand(): Observable<Response<ArrayList<BrandInfo>>>


    /**
     * 获取车系列表
     */
    @FormUrlEncoded
    @POST("controller/getSeriesList")
    fun series(@Field("brandId") brandId: Int): Observable<Response<ArrayList<Series>>>


    /**
     * 获取车身类型的列表
     */
    @GET("controller/getCarTypeList ")
    fun bodyType(): Observable<Response<ArrayList<CarType>>>


    /**
     * 查询省列表
     */
    @POST("controller/area/province")
    fun provinceList(): Observable<Response<List<Province>>>


    /**
     * 查询城市列表
     */
    @FormUrlEncoded
    @POST("controller/area/city")
    fun cityList(@Field("provinceId") provinceId: String? = null): Observable<Response<List<City>>>
}